<template>
  <div>
    <header class="wrapper"> 
    <div class="sui-navbar"> 
     <div class="navbar-inner"> 
      <a href="index-logined.html" class="sui-brand"><img src="~/assets/img/asset-logo-black.png" alt="社交" /></a> 
      <ul class="sui-nav"> 
        <router-link to="/" tag="li" activeClass="active" exact><a>头条</a></router-link>
        <router-link to="/qa" tag="li" activeClass="active"><a>问答</a></router-link>
        <router-link to="/gathering" tag="li" activeClass="active"><a>活动</a></router-link>
        <router-link to="/friends" tag="li" activeClass="active"><a>交友</a></router-link>
        <router-link to="/spit" tag="li" activeClass="active"><a>吐槽</a></router-link>
        <router-link to="/recruit" tag="li" activeClass="active"><a>招聘</a></router-link>

      </ul> 
      <form class="sui-form sui-form pull-left"> 
       <input type="text" placeholder="输入关键词..." /> 
       <span class="btn-search fa fa-search"></span> 
      </form> 
      <div class="sui-nav pull-right info" v-if="user.name!==undefined"> 

       <li><a href="/manager" target="_blank" class="notice">{{user.name}}</a></li> 
       <li><a href="./person-homepage.html" target="_blank" class="homego"><img :src="user.avatar" alt="用户头像" width="50px"/></a></li> 
       <li><button @click="logout" class="sui-btn btn-login">退出</button></li> 

      </div> 

      <div class="sui-nav pull-right info" v-else> 
        <li><a href="/login" target="_blank">注册</a></li> 
        <li><a href="/login" target="_blank" class="sui-btn btn-login">登录</a></li>  
      </div>




     </div> 
    </div> 
   </header>
    <nuxt/>
    <div class="footer"> 
   <div class="wrapper"> 
    <div class="footer-bottom"> 
     <div class="link"> 
      <dl> 
       <dt>
        网站相关
       </dt> 
       <dd>
        关于我们
       </dd> 
       <dd>
        服务条款
       </dd> 
       <dd>
        帮助中心
       </dd> 
       <dd>
        编辑器语法
       </dd> 
      </dl> 
      <dl> 
       <dt>
        常用链接
       </dt> 
       <dd>
        传智播客
       </dd> 
       <dd>
        传智论坛
       </dd> 
      </dl> 
      <dl> 
       <dt>
        联系我们
       </dt> 
       <dd>
        联系我们
       </dd> 
       <dd>
        加入我们
       </dd> 
       <dd>
        建议反馈
       </dd> 
      </dl> 
      <dl> 
       <dt>
        关注我们
       </dt> 
       <dd>
        微博
       </dd> 
       <dd>
        twitter
       </dd> 
      </dl> 
      <div class="xuke"> 
       <h3>内容许可</h3> 
       <p>除特别说明外，用户内容均采用知识共享署名-非商业性使用-禁止演绎4.0 国际许可协议 (CC BY-NC-ND 4.0) 进行许可</p> 
       <p>本站由 传智研究院 提供更新服务</p> 
      </div> 
     </div> 
     <p class="Copyright">Copyright &copy; 2017 传智问答社区 当前版本 0.0.1</p> 
    </div> 
   </div> 
  </div> 
  </div>
</template>

<script>
/**
 *   <link rel="stylesheet" type="text/css" href="./plugins/normalize-css/normalize.css" /> 
  <link rel="stylesheet" type="text/css" href="./plugins/yui/cssgrids-min.css" /> 
  <link rel="stylesheet" type="text/css" href="./plugins/sui/sui.min.css" /> 
  <link rel="stylesheet" type="text/css" href="./plugins/sui/sui-append.min.css" /> 
  <link rel="stylesheet" type="text/css" href="./plugins/font-awesome/css/font-awesome.min.css" /> 
  <link rel="stylesheet" type="text/css" href="./css/widget-base.css" /> 
  <link rel="stylesheet" type="text/css" href="./css/widget-head-foot.css" /> 
 */
import '~/assets/plugins/normalize-css/normalize.css'
import '~/assets/plugins/yui/cssgrids-min.css'
import '~/assets/plugins/sui/sui.min.css'
import '~/assets/plugins/sui/sui-append.min.css'
import '~/assets/plugins/font-awesome/css/font-awesome.min.css'
import '~/assets/css/widget-base.css'
import '~/assets/css/widget-head-foot.css'

import {getUser,removeUser} from '@/utils/auth'
export default {
    data(){
      return {
        user: {}
      }
    },
    created () {
      this.user = getUser();
    },
    methods: {
      logout(){
        //删除cookies中的内容
        removeUser()
        //删除完成cookie跳转页面：login页面
        location.href="/login"

      }
    }
}
</script>
